CC = $(PRE)gcc
XX = $(PRE)g++
TARGET = ../../bin/smartx_linux.exe
CFLAGS = -Wall -O  -I../include -I../../libs/lua/src
LIBS = ../../libs/lua/src/liblua.a -lpthread -lrt -ldl 
#LIBS += /root/openssl-1.0.2n/libcrypto.a

%.o: %.c                                 
	$(CC) $(CFLAGS) -c $< -o $@          

%.o:%.cpp
	$(XX) $(CFLAGS) -c $< -o $@

SOURCES = $(wildcard *.c *.cpp ./include/define.cpp ./include/event.cpp)
OBJS = $(patsubst %.c,%.o,$(patsubst %.cpp,%.o,$(SOURCES)))  

$(TARGET) : $(OBJS)
	$(XX) $(OBJS) -o $(TARGET) $(LIBS)
	chmod a+x $(TARGET)

clean:
	rm -rf $(OBJS) $(TARGET)

